#ifndef UID_H
#define UID_H

#include <limits.h>

#define UID_ID_MAX INT_MAX
#define UID_UNDEFINED -1

#define UID_SUCCESS 0
#define UID_EXHAUSTED 1
#define UID_INVALID 2

typedef struct {
	int next_id;
} uid_pool;

int uid_init(uid_pool *pool, int first_id);
int uid_next(uid_pool *pool, int *next_id);
int uid_reserve(uid_pool *pool, int id);
int uid_reserve_next(uid_pool *pool, int *id);

#endif
